package com.business.bean.oa;

import java.util.Date;

import lombok.Getter;
import lombok.Setter;
import net.sf.rose.jdbc.bean.ModelBean;
import net.sf.rose.jdbc.bean.annotation.Column;
import net.sf.rose.jdbc.bean.annotation.Table;
import net.sf.rose.jdbc.bean.annotation.Type;
import net.sf.rose.jdbc.bean.annotation.View;

/**
 * 工时校对，工时审核都是在工作日报的基础上 1、根据调度编号调出所有附件图片 2、调出相关加班，请假、补漏申请
 * 
 * @author fengjian E-mail: 9110530@qq.com
 * @version 创建时间：2019年9月21日
 */
@Setter
@Getter
@Table(name = "OA_REPORT_DAY", description = "工作日报表")
@View(name = "OA_REPORT_DAY_VIEW", description = "工作日报表")
public class ReportDay extends ModelBean {

	@Column(pk = true, type = Type.定长文本, description = "日报编号", canNull = false, size = 32, policy = "UUID")
	private String dayReportID = null;

	@Column(type = Type.定长文本, description = "调度编号", size = 32)
	private String dispatchID = null;

	@Column(type = Type.定长文本, description = "工程调度编号", size = 32)
	private String dispatchWorkID = null;

	@Column(type = Type.定长文本, description = "用户编号", size = 32)
	private String userID = null;

	@Column(type = Type.变长文本, description = "工号", size = 10)
	private transient String workNo = null;

	@Column(type = Type.变长文本, description = "用户姓名", size = 50)
	private transient String userName = null;

	@Column(type = Type.定长文本, description = "部门编号", size = 32)
	private transient String departID = null;

	@Column(type = Type.变长文本, description = "部门名称", size = 100)
	private transient String departName = null;

	@Column(type = Type.定长文本, description = "工程编号", size = 32)
	private String engineerID = null;

	@Column(type = Type.变长文本, description = "工程名称", size = 200)
	private transient String engineerName = null;

	@Column(type = Type.定长文本, description = "项目编号", size = 32)
	private String projectID = null;

	@Column(type = Type.变长文本, description = "项目名称", size = 200)
	private transient String projectName = null;

	/** yyyy-mm-dd */
	@Column(type = Type.定长文本, description = "日期", size = 10)
	private String calendarDate = null;

	@Column(type = Type.变长文本, description = "刷卡记录", size = 500)
	private String cardRecord = null;

	/** 工作日，假日，节日 */
	@Column(type = Type.变长文本, description = "日期类型", size = 20)
	private String dayType = null;

	/** 1:正常上班;2:请假;3:未分配; */
	@Column(type = Type.数字整型, description = "工作状态")
	private int workStatus = 0;

	/** 1：调度中；2：已调度；3：已分配；4：已确认；5：已校对；6：已审核 */
	@Column(type = Type.数字整型, description = "状态")
	private int status = 0;

	@Column(type = Type.日期时间, description = "排班上班时间")
	private Date startWorkTime = null;

	@Column(type = Type.日期时间, description = "排班下班时间")
	private Date endWorkTime = null;

	@Column(type = Type.数字双精度型, description = "休息时长")
	private double releaseTime = 0;

	@Column(type = Type.日期时间, description = "实际上班时间")
	private Date recordStartWorkTime = null;

	@Column(type = Type.日期时间, description = "实际下班时间")
	private Date recordEndWorkTime = null;

	@Column(type = Type.数字双精度型, description = "工作时长")
	private double workTime = 0;

	@Column(type = Type.数字双精度型, description = "请假时长")
	private double applyTime = 0;

	@Column(type = Type.数字双精度型, description = "加班时长")
	private double overTime = 0;

	@Column(type = Type.数字双精度型, description = "工作总时长")
	private double totalWorkTime = 0;

	@Column(type = Type.数字双精度型, description = "平日加班时长")
	private double overTimeDay = 0;

	@Column(type = Type.数字双精度型, description = "假日加班时长")
	private double overTimeWeekend = 0;

	@Column(type = Type.数字双精度型, description = "节日加班时长")
	private double overTimeHoliday = 0;

	/** -1:未使用，0:使用1次，1：工作时间已经计算完成 */
	@Column(type = Type.数字整型, description = "已计算次数")
	private int usedCount = -1;

	@Column(type = Type.日期时间, description = "提交时间")
	private Date submitTime = null;

	@Column(type = Type.定长文本, description = "确认人编号", size = 32)
	private String confirmUserID = null;

	@Column(type = Type.变长文本, description = "确认人姓名", size = 50)
	private transient String confirmUserName = null;

	@Column(type = Type.日期时间, description = "确认时间")
	private Date confirmTime = null;

	@Column(type = Type.定长文本, description = "校对人编号", size = 32)
	private String checkUserID = null;

	@Column(type = Type.变长文本, description = "校对人姓名", size = 50)
	private transient String checkUserName = null;

	@Column(type = Type.日期时间, description = "校对时间")
	private Date checkedTime = null;

	@Column(type = Type.定长文本, description = "审核人编号", size = 32)
	private String examineUserID = null;

	@Column(type = Type.变长文本, description = "审核人姓名", size = 50)
	private transient String examineUserName = null;

	@Column(type = Type.变长文本, description = "审核备注", size = 250)
	private String examineRemark = null;

	@Column(type = Type.日期时间, description = "审核时间")
	private Date examineTime = null;

	/** 自动考勤，人工考勤 */
	@Column(type = Type.变长文本, description = "考勤方式", size = 20)
	private String checkStlye = null;

	/** 1:上午请假;2:下午请假;3:全天请假; */
	@Column(type = Type.数字整型, description = "请假类别")
	private int applyType = 0;

	@Column(type = Type.变长文本, description = "系统备注", size = 250)
	private String remark = null;

	public void addRemark(String remark) {
		if (this.remark == null) {
			this.remark = remark;
		} else {
			this.remark = this.remark + ',' + remark;
		}
	}

}
